<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D旋转地球</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background: #000;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            overflow: hidden;
        }
        
        .earth-container {
            position: relative;
            width: 300px;
            height: 300px;
            margin: 0 auto;
        }
        
        .earth {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: url('https://threejs.org/examples/textures/planets/earth_atmos_2048.jpg');
            background-size: cover;
            box-shadow: 
                inset 0 0 50px #fff,
                inset 20px 0 80px rgba(150, 150, 255, 0.8),
                inset -20px 0 80px rgba(0, 0, 150, 0.8),
                inset 20px 0 300px rgba(150, 150, 255, 0.8),
                inset -20px 0 300px rgba(0, 0, 150, 0.8),
                0 0 50px #fff,
                -10px 0 80px rgba(150, 150, 255, 0.5),
                10px 0 80px rgba(0, 0, 150, 0.5);
            animation: rotate 20s linear infinite;
        }
        
        .earth-clouds {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: url('https://threejs.org/examples/textures/planets/earth_clouds_1024.png');
            background-size: cover;
            animation: rotate 15s linear infinite;
            opacity: 0.6;
        }
        
        .stars {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
        }
        
        .star {
            position: absolute;
            background: #fff;
            border-radius: 50%;
        }
        
        @keyframes rotate {
            from {
                background-position: 0 0;
            }
            to {
                background-position: 2048px 0;
            }
        }
        
        h1 {
            position: absolute;
            top: 20px;
            width: 100%;
            text-align: center;
            color: white;
            font-family: Arial, sans-serif;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
        }
    </style>
</head>
<body>
    <h1>3D旋转地球</h1>
    <div class="stars" id="stars"></div>
    <div class="earth-container">
        <div class="earth"></div>
        <div class="earth-clouds"></div>
    </div>

    <script>
        // 创建星空背景
        const starsContainer = document.getElementById('stars');
        const starCount = 200;
        
        for (let i = 0; i < starCount; i++) {
            const star = document.createElement('div');
            star.classList.add('star');
            
            // 随机位置和大小
            const size = Math.random() * 3;
            star.style.width = `${size}px`;
            star.style.height = `${size}px`;
            star.style.left = `${Math.random() * 100}%`;
            star.style.top = `${Math.random() * 100}%`;
            
            // 随机透明度
            star.style.opacity = Math.random() * 0.8 + 0.2;
            
            starsContainer.appendChild(star);
        }
    </script>
</body>
</html>